const {
  Random
} = require('mockjs');

export default {
  getRoleList(param){
    console.log('mock___roleList:');
    console.log(param);
    let arr = [];
    let jsonParam = JSON.parse(param.body);
    for(let i=0;i<(15-jsonParam.pageSize * jsonParam.page>0?jsonParam.pageSize:15-jsonParam.pageSize * (jsonParam.page-1));i++){
      arr.push({
        id: Random.id(),
        name: Random.csentence(2, 4),
        status: '启用',
        desc: Random.csentence(10, 30),
      })
    }
    return {
      code: 200,
      message: '',
      data: {
        total: 15,
        list: arr,
        pageSize: jsonParam.pageSize,
        page: jsonParam.page
      }
    }
  }
}
